package com.csci;

public class MainRandomGraph {

	public static void main(String[] args) {
		
		  double averageDiameter = 0;
		  double averageAtomicOperation = 0;
		  double averageExtraSpace = 0;
		  int numberOfTrials = 10;
		  
		  for(int i = 0; i < numberOfTrials; i++){
		  RandomGraph rGraph = new RandomGraph(10000, 5);
		  rGraph.initializeVertices();
		  Graph g = new Graph(); 
		  g.vertex = rGraph.vertex;
		  
		  GraphDiameterAlgorithm gDiameterAlgorithm = new GraphDiameterAlgorithm(g); 
		  
		  	averageDiameter += (double)gDiameterAlgorithm.findDiameter();
		  	averageAtomicOperation += (double) gDiameterAlgorithm.counter;
		  	averageExtraSpace += (double) gDiameterAlgorithm.extraSpace;
		  }
		  
		  System.out.println("The average diameter of " + numberOfTrials + " is " + averageDiameter/numberOfTrials);
		  System.out.println("The average atromic operations of " + numberOfTrials + " is " + averageAtomicOperation/numberOfTrials);
		  System.out.println("The average extraSpace is of " + numberOfTrials + " is " + averageExtraSpace/numberOfTrials);
	}
}
